package com.bjq.controller;

import com.bjq.pojo.Result;
import com.bjq.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

/**
 * .
 * Package Name:   com.yyj.controller
 *
 * @author: YYJ
 * Date Time:      2021/5/24 18:46
 */

@Controller
@RequestMapping("/html")
public class QunController {

    //@Value("${login.test.password}")
    private String password = "123456";



    /**
     * 登录成功后跳转到聊天页面.
     */
    @GetMapping(value = "/toChatroom")
    public String toChatroom() {
        return "chat";
    }

    /**
     * 获取登录成功后存放在session域中的值.
     * @param session
     */
    @GetMapping("/getUsername")
    @ResponseBody
    public String getUsername(HttpSession session){
        return (String) session.getAttribute("username");
    }

}
